package org.br.erp.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.br.erp.base.entity.Scmflowcategory;
import org.br.erp.base.mapper.ScmflowcategoryMapper;
import org.br.erp.base.service.IScmflowcategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: scmflowcategory
 * @Author: jeecg-boot
 * @Date:   2024-03-21
 * @Version: V1.0
 */
@Service
public class ScmflowcategoryServiceImpl extends ServiceImpl<ScmflowcategoryMapper, Scmflowcategory> implements IScmflowcategoryService {

    @Autowired
    private ScmflowcategoryMapper scmflowcategoryMapper;
    @Override
    public Scmflowcategory getFlowCategorybyCatecode(String catecode) {
        QueryWrapper<Scmflowcategory> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("categorycode",catecode);
        List<Scmflowcategory> scmflowcategories = scmflowcategoryMapper.selectList(queryWrapper);

        if(scmflowcategories.size()>0){
            return scmflowcategories.get(0);
        }else{
            return null;
        }
    }
}
